// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.
//
// ███╗   ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
// ████╗  ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
// ██╔██╗ ██║██║   ██║   ██║   ██║██║     █████╗
// ██║╚██╗██║██║   ██║   ██║   ██║██║     ██╔══╝
// ██║ ╚████║╚██████╔╝   ██║   ██║╚██████╗███████╗
// ╚═╝  ╚═══╝ ╚═════╝    ╚═╝   ╚═╝ ╚═════╝╚══════╝
// ------------------------------------------------
//
// This file is automatically generated.
// Please do not edit these files manually.
//
// ------------------------------------------------

#nullable restore

using Elastic.Clients.Elasticsearch.Fluent;
using Elastic.Clients.Elasticsearch.Requests;
using Elastic.Clients.Elasticsearch.Serialization;
using Elastic.Transport;
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Text.Json;
using System.Text.Json.Serialization;

namespace Elastic.Clients.Elasticsearch.MachineLearning;

public sealed partial class GetDatafeedsRequestParameters : RequestParameters
{
	/// <summary>
	/// <para>Specifies what to do when the request:</para>
	/// <para>1. Contains wildcard expressions and there are no datafeeds that match.<br/>2. Contains the `_all` string or no identifiers and there are no matches.<br/>3. Contains wildcard expressions and there are only partial matches.</para>
	/// <para>The default value is `true`, which returns an empty `datafeeds` array<br/>when there are no matches and the subset of results when there are<br/>partial matches. If this parameter is `false`, the request returns a<br/>`404` status code when there are no matches or only partial matches.</para>
	/// </summary>
	public bool? AllowNoMatch { get => Q<bool?>("allow_no_match"); set => Q("allow_no_match", value); }

	/// <summary>
	/// <para>Indicates if certain fields should be removed from the configuration on<br/>retrieval. This allows the configuration to be in an acceptable format to<br/>be retrieved and then added to another cluster.</para>
	/// </summary>
	public bool? ExcludeGenerated { get => Q<bool?>("exclude_generated"); set => Q("exclude_generated", value); }
}

/// <summary>
/// <para>Retrieves configuration information for datafeeds.<br/>You can get information for multiple datafeeds in a single API request by<br/>using a comma-separated list of datafeeds or a wildcard expression. You can<br/>get information for all datafeeds by using `_all`, by specifying `*` as the<br/>`<feed_id>`, or by omitting the `<feed_id>`.<br/>This API returns a maximum of 10,000 datafeeds.</para>
/// </summary>
public sealed partial class GetDatafeedsRequest : PlainRequest<GetDatafeedsRequestParameters>
{
	public GetDatafeedsRequest()
	{
	}

	public GetDatafeedsRequest(Elastic.Clients.Elasticsearch.Ids? datafeedId) : base(r => r.Optional("datafeed_id", datafeedId))
	{
	}

	internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetDatafeeds;

	protected override HttpMethod StaticHttpMethod => HttpMethod.GET;

	internal override bool SupportsBody => false;

	internal override string OperationName => "ml.get_datafeeds";

	/// <summary>
	/// <para>Specifies what to do when the request:</para>
	/// <para>1. Contains wildcard expressions and there are no datafeeds that match.<br/>2. Contains the `_all` string or no identifiers and there are no matches.<br/>3. Contains wildcard expressions and there are only partial matches.</para>
	/// <para>The default value is `true`, which returns an empty `datafeeds` array<br/>when there are no matches and the subset of results when there are<br/>partial matches. If this parameter is `false`, the request returns a<br/>`404` status code when there are no matches or only partial matches.</para>
	/// </summary>
	[JsonIgnore]
	public bool? AllowNoMatch { get => Q<bool?>("allow_no_match"); set => Q("allow_no_match", value); }

	/// <summary>
	/// <para>Indicates if certain fields should be removed from the configuration on<br/>retrieval. This allows the configuration to be in an acceptable format to<br/>be retrieved and then added to another cluster.</para>
	/// </summary>
	[JsonIgnore]
	public bool? ExcludeGenerated { get => Q<bool?>("exclude_generated"); set => Q("exclude_generated", value); }
}

/// <summary>
/// <para>Retrieves configuration information for datafeeds.<br/>You can get information for multiple datafeeds in a single API request by<br/>using a comma-separated list of datafeeds or a wildcard expression. You can<br/>get information for all datafeeds by using `_all`, by specifying `*` as the<br/>`<feed_id>`, or by omitting the `<feed_id>`.<br/>This API returns a maximum of 10,000 datafeeds.</para>
/// </summary>
public sealed partial class GetDatafeedsRequestDescriptor : RequestDescriptor<GetDatafeedsRequestDescriptor, GetDatafeedsRequestParameters>
{
	internal GetDatafeedsRequestDescriptor(Action<GetDatafeedsRequestDescriptor> configure) => configure.Invoke(this);

	public GetDatafeedsRequestDescriptor(Elastic.Clients.Elasticsearch.Ids? datafeedId) : base(r => r.Optional("datafeed_id", datafeedId))
	{
	}

	public GetDatafeedsRequestDescriptor()
	{
	}

	internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetDatafeeds;

	protected override HttpMethod StaticHttpMethod => HttpMethod.GET;

	internal override bool SupportsBody => false;

	internal override string OperationName => "ml.get_datafeeds";

	public GetDatafeedsRequestDescriptor AllowNoMatch(bool? allowNoMatch = true) => Qs("allow_no_match", allowNoMatch);
	public GetDatafeedsRequestDescriptor ExcludeGenerated(bool? excludeGenerated = true) => Qs("exclude_generated", excludeGenerated);

	public GetDatafeedsRequestDescriptor DatafeedId(Elastic.Clients.Elasticsearch.Ids? datafeedId)
	{
		RouteValues.Optional("datafeed_id", datafeedId);
		return Self;
	}

	protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings)
	{
	}
}